﻿using System;
using NUnit.Framework;

namespace AppTwo.Tests
{
    [TestFixture]
    public class SubscriptionTests
    {
        [Test]
        public void CanNotPrint()
        {
            Assert.That(new Subscription { IsCanceled = true }.CanPrint, Is.False);
            Assert.That(new Subscription { IsPrinted = true }.CanPrint, Is.False);
            Assert.That(new Subscription { IsIssued = false }.CanPrint, Is.False);
        }

        [Test]
        public void CanPrint()
        {
            Assert.That(new Subscription { IsIssued = true }.CanPrint, Is.True);
        }

        [Test]
        public void ComputeRateo()
        {           
            Assert.That(new Subscription { Price = 100, NumberShows = 2 }.Rateo, Is.EqualTo(50));
            Assert.That(new Subscription { Price = 215, NumberShows = 6 }.Rateo, Is.EqualTo(35.83m));
        }
    }
}
